<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <{if count($cat_list) > 0}>
  <tr valign="top"> <{foreach from=$cat_list item=product name=goods}></tr>
</table>
      </td>
    <{if !($smarty.foreach.goods.iteration%4)}> </tr>
  <{if !$smarty.foreach.goods.last}>
  <tr valign="top"> <{/if}>

    <{elseif $smarty.foreach.goods.last}>
    <td colspan="<{math equation='4 - y' y=$smarty.foreach.goods.iteration%4}>">&nbsp;</td>
  </tr>
  <{/if}>
  <{/foreach}>

  <{/if}>
</table>